<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: QQtNamedPipe Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#signals">Signals</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="class_q_qt_named_pipe-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QQtNamedPipe Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The <a class="el" href="class_q_qt_named_pipe.html" title="The QQtNamedPipe class 类似于QSharedMemory使用方式。只不过底层使用Pipe(QLocalSocket)实现。 支持同时使...">QQtNamedPipe</a> class 类似于QSharedMemory使用方式。只不过底层使用Pipe(QLocalSocket)实现。 支持同时使用多个命名管道。  
 <a href="class_q_qt_named_pipe.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qqtnamedpipe_8h_source.html">qqtnamedpipe.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for QQtNamedPipe:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_q_qt_named_pipe.png" usemap="#QQtNamedPipe_map" alt=""/>
  <map id="QQtNamedPipe_map" name="QQtNamedPipe_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:adef0cdb3aa9bc64c2ddbb4db4540807a"><td class="memItemLeft" align="right" valign="top"><a id="adef0cdb3aa9bc64c2ddbb4db4540807a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>slotConnectSuccess</b> ()</td></tr>
<tr class="separator:adef0cdb3aa9bc64c2ddbb4db4540807a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cc0bb1e7db80271796bd30f7a609f15"><td class="memItemLeft" align="right" valign="top"><a id="a1cc0bb1e7db80271796bd30f7a609f15"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>slotConnectFail</b> ()</td></tr>
<tr class="separator:a1cc0bb1e7db80271796bd30f7a609f15"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
Signals</h2></td></tr>
<tr class="memitem:ac25735927cc38bafe0fc2f06a44dc37d"><td class="memItemLeft" align="right" valign="top"><a id="ac25735927cc38bafe0fc2f06a44dc37d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>signalConnectComeBack</b> ()</td></tr>
<tr class="separator:ac25735927cc38bafe0fc2f06a44dc37d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a875906677b186a2936098cf132dc7fac"><td class="memItemLeft" align="right" valign="top"><a id="a875906677b186a2936098cf132dc7fac"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>signalStartNamedPipeServer</b> (<a class="el" href="class_q_qt_named_pipe_server.html">QQtNamedPipeServer</a> *)</td></tr>
<tr class="separator:a875906677b186a2936098cf132dc7fac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab7be4910b216ebacfabd75c1dde3207e"><td class="memItemLeft" align="right" valign="top"><a id="ab7be4910b216ebacfabd75c1dde3207e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>QQtNamedPipe</b> (const QString &amp;key, QObject *parent=Q_NULLPTR)</td></tr>
<tr class="separator:ab7be4910b216ebacfabd75c1dde3207e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20607e519076bf2e83ab9f1b6202b68c"><td class="memItemLeft" align="right" valign="top"><a id="a20607e519076bf2e83ab9f1b6202b68c"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>initializer</b> ()</td></tr>
<tr class="separator:a20607e519076bf2e83ab9f1b6202b68c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a21f0bc0afeee35715bf1e827ec9f1a"><td class="memItemLeft" align="right" valign="top"><a id="a9a21f0bc0afeee35715bf1e827ec9f1a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>write</b> (const QByteArray &amp;bytes)</td></tr>
<tr class="separator:a9a21f0bc0afeee35715bf1e827ec9f1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4b8f3a6a5c4ee13e107c465ea170060"><td class="memItemLeft" align="right" valign="top"><a id="aa4b8f3a6a5c4ee13e107c465ea170060"></a>
QByteArray&#160;</td><td class="memItemRight" valign="bottom"><b>read</b> (int size)</td></tr>
<tr class="separator:aa4b8f3a6a5c4ee13e107c465ea170060"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a09ae15f36781af1e6884f27839f95ffa"><td class="memItemLeft" align="right" valign="top"><a id="a09ae15f36781af1e6884f27839f95ffa"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>hasServer</b> ()</td></tr>
<tr class="separator:a09ae15f36781af1e6884f27839f95ffa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a441919fe26ab05753a0097c21f28c1a5"><td class="memItemLeft" align="right" valign="top"><a id="a441919fe26ab05753a0097c21f28c1a5"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>create</b> ()</td></tr>
<tr class="separator:a441919fe26ab05753a0097c21f28c1a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1975252a572ddac54883a395588afd67"><td class="memItemLeft" align="right" valign="top"><a id="a1975252a572ddac54883a395588afd67"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>attach</b> ()</td></tr>
<tr class="separator:a1975252a572ddac54883a395588afd67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dd9e54b685182b53252a4a0a1df1f97"><td class="memItemLeft" align="right" valign="top"><a id="a2dd9e54b685182b53252a4a0a1df1f97"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>setKey</b> ()</td></tr>
<tr class="separator:a2dd9e54b685182b53252a4a0a1df1f97"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="class_q_qt_named_pipe.html" title="The QQtNamedPipe class 类似于QSharedMemory使用方式。只不过底层使用Pipe(QLocalSocket)实现。 支持同时使...">QQtNamedPipe</a> class 类似于QSharedMemory使用方式。只不过底层使用Pipe(QLocalSocket)实现。 支持同时使用多个命名管道。 </p>
<p>原理： 按照key区分管道。 initializer里面的create、attach提供对管道的创建和关联。 packer把自己的数据结构打包写进管道。 parser把管道的数据解包到本地变量。</p>
<p>注意：one key，管道里的数据是顺序的，流的，存在数据结构。 注意：每一次写的数据，读取一次就能读出来。这一次的数据读写长度没有限制。 注意：管道里的数据是顺序的，顺序的，顺序的！谁都可以读也可以写。只要key对号。</p>
<p>多路管道的格式： QString QByteArray key1 pipe1 key2 pipe2 ... ...</p>
<p>文件用于储存数据，管道不用于储存数据，而是作为一个通信设备的驱动，这个通信设备就是个管道。 QQtNamedPipeServer监控这个管道的读写，提交给业务层数据处理。 QQtNamedPipeClient往这个管道里面读写，读取和写入都允许进行。 QQtNamedPipePrivate实现了一个通信协议，包括read业务、write业务。 QQtNamedPipe使用这个协议，开放给用户接口。（也叫做Wrapper，没有这个wrapper管道读写不好实施呀，数据结构、通信架构都说不清楚。）</p>
<p>Windows Timer和QEventLoop堵塞都存在问题，不支持。 理论上，在堵塞的时候qApp processEvents接收到读或者写的返回命令，可是Windows下接收不到，甚至发送都发送不出去，原因不明。 </p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/highgrade/<a class="el" href="qqtnamedpipe_8h_source.html">qqtnamedpipe.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/highgrade/qqtnamedpipe.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
